$ checksec flag [*] '/home/oneshell/PWN/pwnable.kr/flag/flag' Arch: amd64-64-little RELRO: No RELRO Stack: No canary found NX: NX disabled PIE: No PIE (0x400000) RWX: Has RWX segments Packer: Packed with UPX
$ strings flag | grep UPX UPX! $Info: This file is packed with the UPX executable packer http://upx.sf.net $ $Id: UPX 3.08 Copyright (C) 1996-2011 the UPX Team. All Rights Reserved. $ UPX! UPX!
$ ./build/release/upx -d ../flag Ultimate Packer for eXecutables Copyright (C) 1996 - 2023 UPX git-57ad6b Markus Oberhumer, Laszlo Molnar & John Reiser Aug 25th 2023
File size Ratio Format Name -------------------- ------ ----------- ----------- 887219 <- 335288 37.79% linux/amd64 flag
Unpacked 1 file.
WARNING: this is an unstable beta version - use for testing only! Really.
此时可以看到flag已经是not stripped了
1 2
$ file flag flag: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.24, BuildID[sha1]=96ec4cc272aeb383bd9ed26c0d4ac0eb5db41b16, not stripped
puts("I will malloc() and strcpy the flag there. take it.", argv, envp); dest = (char *)malloc(100LL); strcpy(dest, flag); return0; }
1 2 3
.rodata:0000000000496628 aUpxSoundsLikeA db 'UPX...? sounds like a delivery service :)',0 .rodata:0000000000496628 ; DATA XREF: .data:flag↓o .rodata:0000000000496652 align 8